//
//  BaseTabBar.m
//  genericFramework
//
//  Created by 谷丰 on 2025/3/24.
//

#import "BaseTabBar.h"
#import "MySelfVC.h"
#import "FindVC.h"
#import "HeadVC.h"
@interface BaseTabBar ()
@property (nonatomic,strong)BaseNavigationController * OneNav;
@property (nonatomic,strong)BaseNavigationController * TwoNav;
@property (nonatomic,strong)BaseNavigationController * ThrNav;

@end

@implementation BaseTabBar

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBar.tintColor= [BaseWay MainColor];
    HeadVC * head =[[HeadVC alloc]init];
    self.OneNav =[[BaseNavigationController alloc]initWithRootViewController:head];
    self.OneNav.interactivePopGestureRecognizerType=InteractivePopGestureRecognizerEdge;
    [self CreatNav:self.OneNav adddefImage:@"tabgrouporder" andWithSelectImage:@"tabgrouporder-p" andWithTitle:GFString(@"消息")];
    FindVC * find =[[FindVC alloc]init];
    self.TwoNav =[[BaseNavigationController alloc]initWithRootViewController:find];
    self.TwoNav.interactivePopGestureRecognizerType=InteractivePopGestureRecognizerEdge;
    [self CreatNav:self.TwoNav adddefImage:@"live" andWithSelectImage:@"live-p" andWithTitle:GFString(@"通讯录")];
   
    MySelfVC  * myself =[[MySelfVC alloc]init];
    self.ThrNav =[[BaseNavigationController alloc]initWithRootViewController:myself];
    self.ThrNav.interactivePopGestureRecognizerType=InteractivePopGestureRecognizerEdge;
    [self CreatNav:self.ThrNav adddefImage:@"mine" andWithSelectImage:@"mine-p" andWithTitle:GFString(@"我的")];
   
    
    [self addChildViewController:self.OneNav];
    [self addChildViewController:self.TwoNav];
    [self addChildViewController:self.ThrNav];

    if (@available(iOS 15.0, *)) {
        self.tabBar.scrollEdgeAppearance = self.tabBar.standardAppearance;
    }

    // Do any additional setup after loading the view.
}
-(void)CreatNav:(BaseNavigationController *)nav adddefImage :(NSString *)defimage andWithSelectImage:(NSString *)selectImage andWithTitle:(NSString *)title{
     nav.tabBarItem.image = [[UIImage imageNamed:defimage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
     nav.tabBarItem.selectedImage = [[UIImage imageNamed:selectImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
     // 设置一下选中tabbar文字颜色
     nav.navigationBar.hidden =YES;
     nav.tabBarItem.title =title;
    
     NSDictionary *dictHome = [NSDictionary dictionaryWithObject:[BaseWay MainColor] forKey:NSForegroundColorAttributeName];
     [nav.tabBarItem setTitleTextAttributes:dictHome forState:(UIControlStateSelected)];

   

    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
